package com.xhs.main.service.xsb.impl;

import com.xhs.main.dao.xsb.XsbOrderDao;
import com.xhs.main.entity.xsb.Order;
import com.xhs.main.service.xsb.XsbOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hjr
 * @create 2020-10-16-上午 9:57
 */
@Service
public class XsbOrderServiceImpl implements XsbOrderService {

    @Autowired
    XsbOrderDao xsbOrderDao;

    @Override
    public void addOrder(Order order) {
        xsbOrderDao.insertOrder(order);
    }

    @Override
    public List<Order> getAllOrder() {
        List<Order> orders = xsbOrderDao.selectAllOrder();
        return orders;
    }

    @Override
    public List<Order> getAllOrderByVague(Order order) {
        List<Order> orders = xsbOrderDao.selectAllOrderByVague(order);
        return orders;
    }

    @Override
    public List<Order> updateOrder(Order order) {
        xsbOrderDao.updateOrder(order);
        List<Order> orders = xsbOrderDao.selectAllOrder();

        return orders;
    }
}
